home *** CD-ROM | disk | FTP | other *** search
/ Scene 96 / Scene 96 International Edition (Zyklop Software) (Disc 2) (1997).iso / misc / coding / midas060 / src / nosound.c < prev    next >
Encoding:
C/C++ Source or Header  |  1997-01-16  |  4.9 KB  |  328 lines

  1. /*      NOSOUND.C
  2.  *
  3.  * No Sound Sound Device, v2.00. A really stupid one.
  4.  *
  5.  * $Id: nosound.c,v 1.2 1997/01/16 18:41:59 pekangas Exp $
  6.  *
  7.  * Copyright 1996,1997 Housemarque Inc.
  8.  *
  9.  * This file is part of the MIDAS Sound System, and may only be
  10.  * used, modified and distributed under the terms of the MIDAS
  11.  * Sound System license, LICENSE.TXT. By continuing to use,
  12.  * modify or distribute this file you indicate that you have
  13.  * read the license and understand and accept it fully.
  14. */
  15.  
  16. /* None of these functions can fail and practically none of them does
  17.    anything. */
  18.  
  19. #include "lang.h"
  20. #include "mtypes.h"
  21. #include "errors.h"
  22. #include "sdevice.h"
  23.  
  24. RCSID(const char *nosound_rcsid = "$Id: nosound.c,v 1.2 1997/01/16 18:41:59 pekangas Exp $";)
  25.  
  26.  
  27.     /* A lot of functions do not use their arguments: */
  28. #ifdef __WATCOMC__
  29. #pragma off (unreferenced)
  30. #endif
  31.  
  32.  
  33.  
  34.  
  35. /* Names and stuff: */
  36. char            *nsndCard = "No Sound";
  37.  
  38.  
  39. /* Variables: */
  40. static unsigned curSmpHandle;
  41.  
  42. /* And now the functions - coded with regexp search and replace */
  43.  
  44.  
  45. int CALLING nsndDetect(int *result)
  46. {
  47.     *result = 1;
  48.     return OK;
  49. }
  50.  
  51.  
  52. int CALLING nsndInit(unsigned mixRate, unsigned mode)
  53. {
  54.     curSmpHandle = 1;
  55.     return OK;
  56. }
  57.  
  58.  
  59. int CALLING nsndClose(void)
  60. {
  61.     return OK;
  62. }
  63.  
  64.  
  65. int CALLING nsndGetMixRate(unsigned *mixRate)
  66. {
  67.     *mixRate = 44100;
  68.     return OK;
  69. }
  70.  
  71.  
  72. int CALLING nsndGetMode(unsigned *mode)
  73. {
  74.     *mode = sdStereo | sd16bit;
  75.     return OK;
  76. }
  77.  
  78.  
  79. int CALLING nsndOpenChannels(unsigned channels)
  80. {
  81.     return OK;
  82. }
  83.  
  84.  
  85. int CALLING nsndCloseChannels(void)
  86. {
  87.     return OK;
  88. }
  89.  
  90.  
  91. int CALLING nsndClearChannels(void)
  92. {
  93.     return OK;
  94. }
  95.  
  96.  
  97. int CALLING nsndMute(int mute)
  98. {
  99.     return OK;
  100. }
  101.  
  102.  
  103. int CALLING nsndPause(int pause)
  104. {
  105.     return OK;
  106. }
  107.  
  108.  
  109. int CALLING nsndSetMasterVolume(unsigned masterVolume)
  110. {
  111.     return OK;
  112. }
  113.  
  114.  
  115. int CALLING nsndGetMasterVolume(unsigned *masterVolume)
  116. {
  117.     *masterVolume = 0;
  118.     return OK;
  119. }
  120.  
  121.  
  122. int CALLING nsndSetAmplification(unsigned amplification)
  123. {
  124.     return OK;
  125. }
  126.  
  127.  
  128. int CALLING nsndGetAmplification(unsigned *amplification)
  129. {
  130.     *amplification = 64;
  131.     return OK;
  132. }
  133.  
  134.  
  135. int CALLING nsndPlaySound(unsigned channel, ulong rate)
  136. {
  137.     return OK;
  138. }
  139.  
  140.  
  141. int CALLING nsndReleaseSound(unsigned channel)
  142. {
  143.     return OK;
  144. }
  145.  
  146.  
  147. int CALLING nsndStopSound(unsigned channel)
  148. {
  149.     return OK;
  150. }
  151.  
  152.  
  153. int CALLING nsndSetRate(unsigned channel, ulong rate)
  154. {
  155.     return OK;
  156. }
  157.  
  158.  
  159. int CALLING nsndGetRate(unsigned channel, ulong *rate)
  160. {
  161.     *rate = 0;
  162.     return OK;
  163. }
  164.  
  165.  
  166. int CALLING nsndSetVolume(unsigned channel, unsigned volume)
  167. {
  168.     return OK;
  169. }
  170.  
  171.  
  172. int CALLING nsndGetVolume(unsigned channel, unsigned *volume)
  173. {
  174.     *volume =0;
  175.     return OK;
  176. }
  177.  
  178.  
  179. int CALLING nsndSetSample(unsigned channel, unsigned smpHandle)
  180. {
  181.     return OK;
  182. }
  183.  
  184.  
  185. int CALLING nsndGetSample(unsigned channel, unsigned *smpHandle)
  186. {
  187.     *smpHandle = 0;
  188.     return OK;
  189. }
  190.  
  191.  
  192. int CALLING nsndSetPosition(unsigned channel, unsigned pos)
  193. {
  194.     return OK;
  195. }
  196.  
  197.  
  198. int CALLING nsndGetPosition(unsigned channel, unsigned *pos)
  199. {
  200.     *pos = 0;
  201.     return OK;
  202. }
  203.  
  204.  
  205. int CALLING nsndGetDirection(unsigned channel, int *direction)
  206. {
  207.     *direction = 1;
  208.     return OK;
  209. }
  210.  
  211.  
  212. int CALLING nsndSetPanning(unsigned channel, int panning)
  213. {
  214.     return OK;
  215. }
  216.  
  217.  
  218. int CALLING nsndGetPanning(unsigned channel, int *panning)
  219. {
  220.     *panning = panMiddle;
  221.     return OK;
  222. }
  223.  
  224.  
  225. int CALLING nsndMuteChannel(unsigned channel, int mute)
  226. {
  227.     return OK;
  228. }
  229.  
  230.  
  231. int CALLING nsndAddSample(sdSample *sample, int copySample,
  232.     unsigned *smpHandle)
  233. {
  234.     *smpHandle = curSmpHandle;
  235.     curSmpHandle++;
  236.     if ( curSmpHandle > 255 )
  237.         curSmpHandle = 1;
  238.  
  239.     return OK;
  240. }
  241.  
  242.  
  243. int CALLING nsndRemoveSample(unsigned smpHandle)
  244. {
  245.     return OK;
  246. }
  247.  
  248.  
  249. int CALLING nsndSetUpdRate(unsigned updRate)
  250. {
  251.     return OK;
  252. }
  253.  
  254.  
  255. int CALLING nsndStartPlay(void)
  256. {
  257.     return OK;
  258. }
  259.  
  260.  
  261. int CALLING nsndPlay(int *callMP)
  262. {
  263.     *callMP = 1;
  264.     return OK;
  265. }
  266.  
  267.  
  268. /* And the struct: */
  269.  
  270. SoundDevice NoSound = {
  271.     1,                                  /* Poll to tempo */
  272.     0,
  273.     0,
  274.     0,
  275.     0,
  276.     0,
  277.     1,
  278.     0,
  279.     "No Sound Sound Device v2.00",
  280.     &nsndCard,
  281.     0,
  282.     NULL,
  283.     &nsndDetect,
  284.     &nsndInit,
  285.     &nsndClose,
  286.     &nsndGetMixRate,
  287.     &nsndGetMode,
  288.     &nsndOpenChannels,
  289.     &nsndCloseChannels,
  290.     &nsndClearChannels,
  291.     &nsndMute,
  292.     &nsndPause,
  293.     &nsndSetMasterVolume,
  294.     &nsndGetMasterVolume,
  295.     &nsndSetAmplification,
  296.     &nsndGetAmplification,
  297.     &nsndPlaySound,
  298.     &nsndReleaseSound,
  299.     &nsndStopSound,
  300.     &nsndSetRate,
  301.     &nsndGetRate,
  302.     &nsndSetVolume,
  303.     &nsndGetVolume,
  304.     &nsndSetSample,
  305.     &nsndGetSample,
  306.     &nsndSetPosition,
  307.     &nsndGetPosition,
  308.     &nsndGetDirection,
  309.     &nsndSetPanning,
  310.     &nsndGetPanning,
  311.     &nsndMuteChannel,
  312.     &nsndAddSample,
  313.     &nsndRemoveSample,
  314.     &nsndSetUpdRate,
  315.     &nsndStartPlay,
  316.     &nsndPlay
  317. };
  318.  
  319.  
  320. /*
  321.  * $Log: nosound.c,v $
  322.  * Revision 1.2  1997/01/16 18:41:59  pekangas
  323.  * Changed copyright messages to Housemarque
  324.  *
  325.  * Revision 1.1  1996/05/22 20:49:33  pekangas
  326.  * Initial revision
  327.  *
  328. */